package simple

import (
	"fmt"
	"sync"
	"time"
)

var singleton *Singleton

type Singleton struct {
}

func getInstance(wg *sync.WaitGroup) *Singleton {
	defer wg.Done()
	if nil == singleton {
		fmt.Println("init ...")
		time.Sleep(time.Second)
		singleton = &Singleton{}
	}
	return singleton
}
